import request from "@/utils/request";

// 获取员工
export function getRolusInfo(pageInfo) {
  return request({
    url: "/sys/role",
    params: pageInfo
  });
}

// 删除员工
export function delRolue(id) {
  return request({
    url: `/sys/role/${id}`,
    method: "DELETE"
  });
}

// 新增员工
export function addRolue(data) {
  return request({
    url: "/sys/role",
    method: "post",
    data
  });
}
// 修改

export function editRolue(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: "PUT",
    data
  });
}

// 获取员工
export function getRolue(id) {
  return request({
    url: `/sys/role/${id}`
  });
}

// 获取详细信息
export function getCompanyDetail(id) {
  return request({
    url: `/company/${id}`
  });
}

/**
 * 给角色分配权限
 * @param {*} data
 */
export function assignPermission(data) {
  return request({
    url: "/sys/role/assignPrem",
    method: "put",
    data
  });
}
